package com.lizemin.websocketserver.controller;

import com.lizemin.websocketserver.handler.SimpleWebSocketServerHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lzm
 * @date 2025/6/4 21:04
 * @description
 */
@RestController
public class WebsocketServerController {

    @Autowired
    private SimpleWebSocketServerHandler socketServerHandler;

    /**
     * 给客户端发送消息的接口
     *
     * @param message 消息内容
     */
    @GetMapping("/send")
    public void sendMessage(String message) {
        socketServerHandler.sendMessage(message);
    }
    
    
}
